package com.tom.simplebeancontainer.springframework;

import java.util.HashMap;
import java.util.Map;

/**
 * 简单工厂
 *
 * @author zx
 * @date 2024-11-05 09:18
 */
public class BeanFactory {
    private Map<String, BeanDefinition> beanDefinitionMap = new HashMap<>();

    public Object getBean(String name){
        return beanDefinitionMap.get(name).getBean();
    }

    public void registerBeanDefinition(String name, BeanDefinition beanDefinition){
        beanDefinitionMap.put(name, beanDefinition);
    }
}
